 <%@ page language="java" contentType="text/html; charset=UTF-8"       
    pageEncoding="UTF-8"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>      
<%
	String basePath = request.getContextPath() + "/";
%>        
 <!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>工单录入</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/display.css"/>
		<!--[if lt IE 9]><script src="<%=basePath %>js/html5.js"></script><![endif]-->	
		<link rel="stylesheet" href="<%=basePath %>js/plugin/kindeditor/themes/default/default.css" />
		<script src="<%=basePath %>js/jquery.min.js"></script>
		<script charset="utf-8" src="<%=basePath %>js/plugin/kindeditor/kindeditor-min.js"></script>		
		<script charset="utf-8" src="<%=basePath %>js/plugin/kindeditor/lang/zh_CN.js"></script>			
		<script>
			var editor;
			var editorJosn={
					cssPath:'<%=basePath %>js/plugin/kindeditor/plugins/code/prettify.css',
					uploadJson:'<%=basePath %>js/plug/kindeditor/jsp/upload_json.jsp',
					fileManangetJson:'<%=basePath %>js/plug/kindeditor/jsp/file_manager_json.jsp',
					resizeType : 1,
					allowPreviewEmoticons : false,
					allowImageUpload : false,
					allowFileManager : true,
					items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'link']
			};
		</script>
		<script src="<%=basePath %>js/work_order_deal.js"></script>	
	</head>
	<body onload="javascript:parent.window.scrollTo(0,0);">
		<div class="formWrap">
			<div class="listSearch-title pen-title">
			<h5>工单处理</h5>
			<span class="addTime">创建于<fmt:formatDate  value="${cussWorkOrder.createTime}" pattern="yyyy-MM-dd:HH:mm:ss"></fmt:formatDate></span>
			<c:if test="${cussWorkOrder.urgentPriority=='10'}"><div class="priority low"></div></c:if>
			<c:if test="${cussWorkOrder.urgentPriority=='30'}"><div class="priority normal"></div></c:if>
			<c:if test="${cussWorkOrder.urgentPriority=='50'}"><div class="priority urgent"></div></c:if>
			<c:if test="${cussWorkOrder.urgentPriority=='70'}"><div class="priority veryUrgent"></div></c:if>
			</div>
		    <input id="idWorkOrder" type="hidden" value="${cussWorkOrder.idWorkOrder}"></input>
		    <input id="typeIdHidden" type="hidden" value="${cussWorkOrder.typeId}"></input>
		    <input id="channelSourceHidden" type="hidden"  value="${cussWorkOrder.channelSource}"></input>	
		    <input id="opType" type="hidden" value="${opType}"></input>	    
		    <input id="workOrderHandlerUm" type="hidden" ></input>
		    <input id="dealType" type="hidden" ></input>
		    <input id="workOrderStatus" type="hidden"  value="${cussWorkOrder.workOrderStatus}"></input>
			<table cellpadding="0" cellspacing="0" border="0" class="form-table">
				<tr>
					<td class="form-title w120">工单号：</td>
					<td   class="form-input"><span id="serialNumber" >${cussWorkOrder.serialNumber}</span></td>
					<td class="form-title">工单类型：</td>
					<td  class="form-input">
					<span id="typeId" >${cussWorkOrder.typeName}</span></td>
				    <td class="form-title">渠道来源：</td>
				    <td class="form-input">
				    <span id="channelSource"  >
				    	${cussWorkOrder.channelSource=='1'?'客户录入':(cussWorkOrder.channelSource=='2'?'电话接听':'系统监控')}
				    </span>
				    </td>
				</tr>
				<tr>
					<td class="form-title">客户帐号：</td>
					<td class="form-input"><span id="custName" >${cussWorkOrder.customerName}</span></td>
					<td class="form-title">客户联系电话：</td>
					<td class="form-input"><span   id="custTel"  >${cussWorkOrder.customerPhone}</span></td>
					<td class="form-title">订单编号：</td>
					<td class="form-input"><span  id="cussOrderCode" >${cussWorkOrder.orderNum}</span></td>
				</tr>
				<tr>
					<td class="form-title">工单状态：</td>
					<td class="form-input"><span id="workOrderStatusShow">
					${cussWorkOrder.statusName}</span>					
					</td>
					<td class="form-title">最近处理人：</td>
					<td class="form-input"><span id="lastUpdatorUm">${cussWorkOrder.currOperatorUm}</span></td>
					 <td class="form-title">最近处理时间：</td>
					<td class="form-input">
					<span id="lastUpdateTime"><fmt:formatDate  value="${cussWorkOrder.lastUpdateTime}" pattern="yyyy-MM-dd:HH:mm:ss"></fmt:formatDate></span>				
					</td>
				</tr>
				<tr>
					<td class="form-title">紧急程度：</td>
					<td colspan="5" class="form-input">
						<span  id="workOrderStatusShow">
							${cussWorkOrder.urgentName}
						</span>
					</td>
				</tr>
				<tr>
					<td class="form-title">问题描述：</td>
					<td colspan="5" class="form-input">
						<span>${cussWorkOrder.issuDesc}</span>
					</td>
				</tr>				
			
				<!-- 历史记录 start -->
				<tr>
					<td colspan="6">
						<div class="replyTop clearfix">
							<h4>工单历史日志</h4>
							<c:if test="${cussWorkOrder.workOrderStatus !='5' and cussWorkOrder.workOrderStatus !='8' and cussWorkOrder.workOrderStatus !='7' and cussWorkOrder.workOrderStatus !='9'}">
							
								<div align="right" class="mr20 dealToolBar">
									<button id="add_record_btn" class="btn-form">添加日志</button>
									
									<c:if test="${cussWorkOrder.workOrderStatus =='4' or cussWorkOrder.workOrderStatus =='11'}">
										<button id="inHand_btn" onclick="cussWorkOrderDeal('inHand')" class="btn-form">处理中</button>
										<c:choose>
											<c:when test="${cussWorkOrder.channelSource =='1'}">
										       <button id="applyBack_btn" onclick="cussWorkOrderDeal('applyBack')" class="btn-form">打回</button>
									        </c:when>
									    </c:choose>     
									</c:if>
									
									<c:if test="${cussWorkOrder.workOrderStatus =='6'}">
										<c:choose>
											<c:when test="${cussWorkOrder.channelSource =='1'}">
												<button id="completed_btn" onclick="cussWorkOrderDeal('completed')" class="btn-form">提交审核</button>
											</c:when>
											<c:otherwise>
												<button id="completed_btn" onclick="cussWorkOrderDeal('completed')" class="btn-form">已完成</button>
											</c:otherwise>
										</c:choose>
									</c:if>
									
									<button id="closed_btn" onclick="cussWorkOrderDeal('closed')" class="btn-form">关闭</button>
									<button id="assign_btn" onclick="cussWorkOrderDeal('appoint')" class="btn-form">指派</button>
									<div class="opt_panel" style="right:13px;" id="assign_panel">
										<ul class="opt_panel_ul" id="assign_panel_ul">
									 	</ul>
								 	</div>
								 	
								 	<button id="urgent_level_btn" style='width: 80px;' class="btn-form">紧急程度</button>
									<div class="opt_panel" id="urgent_level_panel">
										<ul class="opt_panel_ul" id="aurgent_level_ul">
									 		<li value="10" onclick="cussWorkOrderDeal('urgent','10')" class="black">低</li>
									 		<li value="30" onclick="cussWorkOrderDeal('urgent','30')" class="green">一般</li>
									 		<li value="50" onclick="cussWorkOrderDeal('urgent','50')" class="orange">紧急</li>
									 		<li value="70" onclick="cussWorkOrderDeal('urgent','70')"><span class="red">非常紧急</span></li>
									 	</ul>
								 	</div>
								 </div>
							 </c:if>
						</div>						
						<div class="replyList" >
							<div id="operateFlowLogDiv" class="edt-item clearfix">
								<textarea  id="operateFlowLog" class="textarea" name="suggest"></textarea>
								<div class="edt_tool_bar">
									<button style="width: 80px;" id="publish_btn" onclick="cussWorkOrderDeal('submit')"  class="btn-form">发布</button>
									<button style="width: 80px;" id="cancle_btn" class="btn-form">取消</button>
								</div>
							</div>
							<div id="replyList">
							</div>
						</div>					
					</td>
				</tr>
				<!-- 历史记录 end -->
			</table>
		</div>
	</body>	
<!--插件引用-->
<script id="table-template" type="text/x-handlebars-template">
				  {{#if results}}
		                {{#each results}}
			             <div class="reply-item clearfix">
								<div class="reply-head">
									<img src="<%=basePath %>image/reply-head.jpg" width="46" height="46"/>
									<div class="reply-head-role">{{#showRoleName creatorRole}}{{/showRoleName}}</div>
								</div>
								<div class="reply-info">
									<p>
										<span class="reply-name">{{creator}}</span> <span class="reply-company ml10 mr10">{{creatorName}}</span> <span class="reply-addTime">{{showDateFormat createTime}}</span>
									</p>
									<p class="reply-content">
										{{{operateFlowLog}}}
									</p>
								</div>
							</div> 
		               {{/each}} 
	               {{else}}
	                  <tr><td> 暂无处理数据！</td></tr>
	               {{/if}}				
		      <!-- {{#if results}}                             
		              <tr>  
						<td colspan="3">
							<p style="float:left;">
								一共 {{totalRecord}} 条记录&nbsp;|&nbsp;分 {{totalPage}} 页&nbsp;|&nbsp;每页 {{pageSize}} 条记录
							</p>
						</td>
						<td colspan="5">	
							<p style="float:right;">
		
		       {{#compare currentPage 1}}
		           <span  onclick="queryDealRecordsPageOp(1)">首页</span>
		           <span  onclick="queryDealRecordsPageOp({{currentPage}}-1)">上一页</span>
		       {{else}}
		           <span class="pageText pageDisable">首页</span>
		           <span class="pageText pageDisable">上一页</span> 
		       {{/compare}}
		      
		       {{#list listbegin listend currentPage}}                                                            
		       {{/list}}
		          
		       {{#compare2 currentPage totalPage}}  
		           <span  onclick="queryDealRecordsPageOp({{currentPage}}+1)">下一页</span>
		           <span  onclick="queryDealRecordsPageOp({{totalPage}})">末页</span>
		       {{else}}
		           <span class="pageText pageDisable">下一页</span>
		           <span class="pageText pageDisable">末页</span>  
		       {{/compare2}}        
							</p>
						</td>
					</tr>
		      {{/if}}	-->			
</script>
	<script src="<%=basePath %>/js/plugin/artDialog/artDialog.source.js?skin=chrome"></script>
    <script src="<%=basePath %>/js/plugin/artDialog/plugins/iframeTools.source.js"></script>
    <script src="<%=basePath %>js/common.js"></script>	
    <script src="<%=basePath %>js/main.js"></script>
	<script src="<%=basePath %>js/handlebars-1.0.0.beta.6.js"></script>	
	<script src="<%=basePath %>js/dateFormat.js"></script>		
</html>